package com.testfileupload.uploadimg.design.iterator;

public class Boss {
    public static void main(String[] args) {
        //定义一个list 放所有项目对象
//        ArrayList<IProject> projects = new ArrayList<>();
//        projects.add(new Project("星球大战项目", 12, 100));
//        projects.add(new Project("时空旅行项目", 23, 1000));
//        projects.add(new Project("超人改造项目", 43, 10000));
//        for (IProject project : projects) {
//            System.out.println(project.getProjectInfo());
//        }
        IProject project = new Project();
        project.add("星球大战项目", 12, 100);
        project.add("时空旅行项目", 23, 1000);
        project.add("超人改造项目", 43, 10000);
        //遍历一下arraylist
        IProjectIterator projectIterator = project.iterator();
        while (projectIterator.hasNext()) {
            Project next = (Project) projectIterator.next();
            System.out.println(next.getProjectInfo());
        }

    }
}
